<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
                xmlns:h="http://xmlns.jcp.org/jsf/html"
                xmlns:f="http://xmlns.jcp.org/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                template="/WEB-INF/template.xhtml">

    <ui:define name="title">
        FileUpload <span class="subitem">Single</span>
    </ui:define>

    <ui:define name="description">
        Single mode allows only one file to be selected at a time from the native file dialog.
    </ui:define>

    <ui:param name="documentationLink" value="/components/fileupload"/>
    <ui:param name="widgetLink" value="FileUpload-1"/>

    <ui:define name="implementation">
        <div class="card">
            <h:form enctype="multipart/form-data">
                <p:fileUpload listener="#{fileUploadView.handleFileUpload}" mode="advanced" dragDropSupport="false"
                              update="messages" accept=".gif,.jpg,.jpeg,.png"
                              onupload="return confirm('Are you sure?')">
                        <p:validateFile sizeLimit="100000" fileLimit="3" allowTypes="/(\.|\/)(gif|jpe?g|png)$/" contentType="true" />
                </p:fileUpload>

                <p:growl id="messages" showDetail="true"/>
            </h:form>
        </div>
    </ui:define>

</ui:composition>
